<!DOCTYPE html>
<html>
<body>
<script>
test(function() {
   var doc = document.currentScript.ownerDocument;
   assert_throws('INVALID_STATE_ERR', function() { doc.open(); }, 'document.open()');
   assert_throws('INVALID_STATE_ERR', function() { doc.write('Hello'); }, 'document.write()');
   assert_throws('INVALID_STATE_ERR', function() { doc.open(); }, 'document.close()');
}, 'Throws an InvalidStateError exception if the Document is an import: From an import');
</script>
</body>
</html>
